/*
 * DeltaHeadingAction.cpp
 *
 *  Created on: 15/lug/2014
 *      Author: va2013
 */

#include "DeltaHeadingAction.h"

DeltaHeadingAction::DeltaHeadingAction() :
ArAction("DeltaHeadingAction", "Effettua la rotazione di un angolo specificato") {
	isRotationInitialized = false;
	degree = 0;
}

DeltaHeadingAction::~DeltaHeadingAction() {

}

ArActionDesired* DeltaHeadingAction::fire(ArActionDesired currentDesired) {
	std::cout << "\nDelta Heading...\n";

	myAction.reset();
	//if (isRotationInitialized) {

		myAction.setDeltaHeading((double)degree, 0.50);
		isRotationInitialized = false;
//	}

	return &myAction;
}

void DeltaHeadingAction::setDeltaHeading(int degree) {
	this->degree = degree;
	isRotationInitialized = true;
}
